class CreateDataProviders < ActiveRecord::Migration
  def self.up
    create_table :data_providers do |t|
      t.column :name, :string
      t.column :logo, :string
      t.column :home_url, :string
      t.column :copyright_notice, :text
      t.column :acknowledgement, :string
      t.column :risk_disclaimer, :text
      t.column :full_name, :string #Not originally part of this migration ...
    end
    add_column :data_objects, :data_provider_id, :integer
    
    execute "alter table data_objects add constraint fk_data_object_data_providers foreign key (data_provider_id) references data_providers(id)"
  end

  def self.down
    execute "alter table data_objects drop foreign key fk_data_object_data_providers"
    remove_column :data_objects, :data_provider_id
    drop_table :data_providers
  end
end
